<template>
  <!-- 修改资料 -->

  <div>
    <el-form
      label-width="85px"
      :model="form"
      label-position="right"
      ref="formRef"
      disabled
      class="borderNone"
    >
      <el-form-item label="编号" prop="number">
        <el-input v-model="form.number"></el-input>
      </el-form-item>
      <el-form-item label="地区名称" prop="name">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="上级地区" prop="parentId">
        <el-input v-model="form.parentlName"></el-input>
      </el-form-item>
      <el-form-item label="级别" prop="areaLevel">
        <el-input v-model="form.areaLevelName"></el-input>
      </el-form-item>
      <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="省市区">
            <el-row :gutter="15">
              <el-col :span="8">
                <el-input v-model="form.province"  class="borderNone"></el-input>
              </el-col>
              <el-col :span="8">
                <el-input v-model="form.city" class="borderNone"></el-input>
              </el-col>
              <el-col :span="8">
                <el-input v-model="form.district"  class="borderNone"></el-input>
              </el-col>
          </el-row>
          </el-form-item>
        </el-col>
      <el-form-item label="状态" prop="status">
        <el-switch
          v-model="form.status"
          size="large"
          inline-prompt
          :active-icon="Check"
          :inactive-icon="Close"
          active-value="normal"
          inactive-value="disable"
        />
      </el-form-item>
    </el-form>
    <div class="button-position">
      <el-button @click="updateVisible">退出</el-button>
    </div>
  </div>
</template>
    
  <script setup>
import { reactive, ref, watch, onMounted } from "vue";
import { ElNotification } from "element-plus";
import { Check, Close } from "@element-plus/icons-vue";
import Api from "@/api/model/crm";
const emit = defineEmits(["updatetable"]);
onMounted(() => {
  getParent();
});

const props = defineProps({
  paramsData: {
    type: Object,
    defalut: {},
  },
});

// 添加用户数据的对象
const form = ref({});
const configData = ref({});
const formRef = ref();

const updateVisible = (val) => {
  emit("updatetable");
};

const parentData = ref([]);
const getParent = async () => {
  let res = await Api.area.detail.post(props.paramsData);
  form.value = res.data;
  configData.value = res.configData;
};

const restAddFormData = () => {
  formRef.value.resetFields();
};
</script>
    
<style scoped lang="less">
.borderNone {
  :deep(.el-input__wrapper) {
    box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color))
      inset;
    cursor: default;
    background-color: transparent; //背景颜色透明
    border-bottom: 1px solid #999;
    border-radius: 0;

    .el-input__inner {
      cursor: default !important;
    }
  }
}
</style>
    
    